Skip to content

chore: enable typescript-eslint/explicit-function-return-type #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2025

Conversation

nirinchev
Copy link
Collaborator

Proposed changes

Checklist

@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 12:43
@nirinchev nirinchev requested a review from a team as a code owner August 7, 2025 12:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the TypeScript ESLint rule @typescript-eslint/explicit-function-return-type to enforce explicit return type annotations on functions throughout the codebase. The change improves code clarity and type safety by requiring developers to explicitly declare what their functions return.

  • Enable the ESLint rule for explicit function return types
  • Add explicit return type annotations to functions across test files and source code
  • Add ESLint disable comments for auto-generated API client methods

Reviewed Changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eslint.config.js Enables the @typescript-eslint/explicit-function-return-type ESLint rule
tests/unit/transports/stdio.test.ts Adds : void return type to callback function
tests/unit/telemetry.test.ts Adds : void return type to test helper function
tests/integration/tools/mongodb/mongodbHelpers.ts Adds return types to helper functions and test utilities
tests/integration/tools/mongodb/metadata/logs.test.ts Adds : void return type to validation function
tests/integration/tools/mongodb/metadata/listDatabases.test.ts Adds : void return type to validation function
tests/integration/tools/mongodb/delete/deleteMany.test.ts Adds : Promise<void> return types to async helper functions
tests/integration/tools/mongodb/create/insertMany.test.ts Adds : Promise<void> return type to validation function
tests/integration/tools/mongodb/create/createIndex.test.ts Adds : Promise<void> return type to validation function
tests/integration/tools/atlas/clusters.test.ts Adds return types to utility functions
tests/integration/tools/atlas/atlasHelpers.ts Adds return types to test helper functions
tests/integration/tools/atlas/accessLists.test.ts Adds : string return type to helper function
tests/integration/inMemoryTransport.ts Adds : void return types to stream handlers
tests/integration/helpers.ts Adds return types to getter functions
tests/integration/fixtures/httpsServerProxyTest.ts Adds : void return type to connection handler
tests/integration/common/connectionManager.test.ts Adds return type to helper function
tests/integration/common/apiClient.test.ts Adds : void return type to test helper
tests/accuracy/sdk/models.ts Adds : LanguageModelV1 return types to model getter methods
tests/accuracy/sdk/describeAccuracyTests.ts Adds : void return type to describe function
tests/accuracy/sdk/agent.ts Adds return type to agent prompt method
src/transports/streamableHttp.ts Adds return types to request handlers and callbacks
src/tools/tool.ts Adds : void return type to update function
src/tools/atlas/read/listDBUsers.ts Adds : string return types to formatting functions
src/telemetry/telemetry.ts Adds : Promise<string> return type to machine ID function
src/server.ts Adds : void return types to server event handlers and registration methods
src/resources/resource.ts Adds : Promise<void> return type and ESLint disable comment
src/index.ts Adds : Promise<void> return types to main and shutdown functions
src/common/session.ts Adds : void return type to agent runner setter
src/common/managedTimeout.ts Adds : void return types to timeout control functions
src/common/config.ts Adds : Partial<UserConfig> return type to CLI config parser
src/common/atlas/apiClient.ts Adds return type to access token method and ESLint disable comments for auto-generated methods
src/common/atlas/accessListUtils.ts Adds return type to access list entry function
scripts/filter.ts Adds : Promise<string> and : Promise<void> return types to script functions
scripts/apply.ts Adds : Promise<void> return type and ESLint disable comment for generated code
scripts/accuracy/generateTestSummary.ts Adds return types to helper functions and defines missing interface

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 16804813849

Details

  • 24 of 27 (88.89%) changed or added relevant lines in 13 files are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 81.062%

Changes Missing Coverage Covered Lines Changed/Added Lines %
eslint.config.js 0 1 0.0%
src/index.ts 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
src/tools/atlas/connect/connectCluster.ts 8 73.31%
Totals Coverage Status
Change from base Build 16790900568: -0.2%
Covered Lines: 3514
Relevant Lines: 4294

💛 - Coveralls

Copy link
Collaborator

@himanshusinghs himanshusinghs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I feel like it should be fine to be lenient for tests but no strong opinion.

@nirinchev nirinchev merged commit 1f7cef4 into main Aug 7, 2025
18 checks passed
@nirinchev nirinchev deleted the ni/more-eslint branch August 7, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants